-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add docs for publish signal #163
Conversation
Can we add an example usage in the docs like in versioning? Makes it much easier for anyone using the signal: https://github.com/divio/djangocms-versioning/blob/master/docs/signals.rst |
8e93f0b
to
ae967e9
Compare
@Aiky30 I've added an example as well. |
docs/signals.rst
Outdated
|
||
|
||
@receiver(published) | ||
def do_something_unpublish_event(*args, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be "publishing" rather than "unpublishing"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change this to do_something_on_published_event
Related to #166, do we want to have a separate event trigger for unpublished? For a user of the library it would be clearer, technically you would be able to achieve the same by checking whether the workflow is is_unpublishing
or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I'd go for separate signals as they are separate concerns. We should stay consistent with Versioning.
ae967e9
to
d766a8d
Compare
I’ve updated the documentation to add a separate signal for called
unpublished.
This signal is added in the pr where the rest of the unpublished flow exists
On Mon 21. Oct 2019 at 13:34, Aiky30 ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In docs/signals.rst
<#163 (comment)>
:
> +The CMS used to provide page publish and unpublish signals which have since been removed in DjangoCMS 4.0. You can instead use the signals provided above to replace these.
+
+Djangocms-moderation provides a way to take further actions once a collection has been published. The `published` event is the last event executed for a moderation.
+
+
+.. code-block:: python
+
+ from django.dispatch import receiver
+
+ from cms.models import PageContent
+
+ from djangocm_moderation.signals import published
+
+
+ @receiver(published)
+ def do_something_unpublish_event(*args, **kwargs):
Personally I'd go for separate signals as they are separate concerns. We
should stay consistent with Versioning.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#163>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQGYEXXVQLTR5QLPCIB5MTQPWHVBANCNFSM4JALN2GQ>
.
--
Sent from Gmail Mobile
|
Merging with failures due to the fact that this is documentation and contains no code changes. CircleCI have changed their pricing plan and we are using features that are no longer part of the open source offering. |
Docs as promised in #159